package com.ioc.demo.controller;

import com.ioc.demo.config.UserInfo;
import com.ioc.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;


@Controller
public class UserController {

    //属性注入
    @Autowired
    private UserService us;
    @Autowired
    private UserInfo userInfo;


    /*//构造方法注入
    private UserService us;

    public UserController(UserService us) {
        this.us = us;
    }*/


    /*//Setter方法注入
    private UserService us;


    @Autowired
    public void setUs(UserService us) {
        this.us = us;
    }*/

    public void doController(){
        us.doService();
        System.out.println(userInfo);
        System.out.println("do Controller...");
    }
}
